package com.xyyx.shopping_manager_api.security;

import com.xyxy.shopping_common.exception.BusException;
import com.xyxy.shopping_common.result.BaseResult;
import com.xyxy.shopping_common.result.CodeEnum;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.nio.file.AccessDeniedException;

/*
* 统一异常处理器
* */
@RestControllerAdvice
public class AccessDeniedExceptionHandler{
    // 处理权限不足异常，捕获到异常后再次抛出，交给AccessDeniedHandler处理
    @ExceptionHandler(AccessDeniedException.class)
    public void defaultExceptionHandler(AccessDeniedException e) throws AccessDeniedException {
        throw e;
    }
}
